<%--***************************************************************************	
    Created By		: Novan Ananda
    Template        : BBApp_MainScreen
 	Date created 	: 20 Aug 2010 
 	Module 	        : Simas Widget
 	Comments 		: Simas Widget
 --------------------------------------------------------------------------------
 DATE			PROGRAMMER			REMARKS
 --------------------------------------------------------------------------------
 20 Aug 2010	Novan Ananda		Initial Version
 -------------------------------------------------------------------------------- --%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> 
<%@ page import="java.util.*, blackberryAppCom.*, blackberryApp.BBApp_cjbREG_MAIN"%>
<jsp:useBean id="lObjBBApp_cjbBBApp" class="blackberryApp.BBApp_cjbBBApp" scope= "request"/>

<%	
try { 
		String lStrLocalPath 	= BBApp_Common.fnGetProperty("LOCAL_PATH");
		
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>SimasNet</title>
    
    <META HTTPS-EQUIV="Pragma" CONTENT="no-cache">
	<META HTTPS-EQUIV="Expires" CONTENT="-1">
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	
    <style type="text/css">
		tr {
			font-size: x-small;
		}
		td {
			font-size: x-small;
		}
		.header {
			font-size: x-small;
			font-weight: bold;
			background: black;
			color: white;
			text-align: center;
			vertical-align: middle;
		}
		.text {
			font-size: x-small;
			font-weight: normal;
			text-align: left;
			vertical-align: top;
		}
		.number {
			font-size: x-small;
			font-weight: normal;
			text-align: right;
			vertical-align: top;
		}
	</style>
	
    <script type="text/javascript">
    function fnStatusPolis() {
        document.getElementById("rowSlctStsPolis").style.display = "";
        document.getElementById("rowLoginSimasSehat").style.display = "none";
	}
	
	function fnSlctStsPolis() {
		var vIdx = document.getElementById("slctStsPolis").selectedIndex;
		var vValue = document.getElementById("slctStsPolis")[vIdx].value;
		if (vValue == '1') {
			document.getElementById("rowSlctStsPolis").style.display = "none";
			document.getElementById("lblAktif").innerHTML = "Simas Sehat";
			document.getElementById("rowLoginSimasSehat").style.display = "";

			document.getElementById("rowLoginSimasMobil").style.display = "none";
		} else if (vValue == '2') {
			document.getElementById("rowLoginSimasSehat").style.display = "none";
			
			document.getElementById("rowSlctStsPolis").style.display = "none";
			document.getElementById("lblAktif").innerHTML = "Simas Mobil";
			document.getElementById("rowLoginSimasMobil").style.display = "";
		}
	}
	
    function fnSimasSehat() {
        var vNoKartu = document.getElementById("txtNoKartu").value;
        var vNoPolis = document.getElementById("txtNoPolis").value;
        var vNoReg = document.getElementById("txtNoReg").value;
        var vTglLahir = document.getElementById("txtTglLahir").value;
    	document.main_form.hidNoKartu.value = vNoKartu;
    	document.main_form.hidNoPolis.value = vNoPolis;
    	document.main_form.hidNoReg.value = vNoReg;
    	document.main_form.hidTglLahir.value = vTglLahir;
        document.main_form.hidMode.value = 1;
        document.main_form.method = "POST";
        document.main_form.action = "<%= lStrLocalPath %>BBApp_cMainScreen";
		document.main_form.submit();
	}

    function fnSimasMobil() {
        var vNoPlat = document.getElementById("txtNoPlat").value; // B6VS
        var vNoPolis = document.getElementById("txtNoPolis").value; // 02055200719842
        var vNoRangka = document.getElementById("txtNoRangka").value; // 02055200719842
        var vNoMesin = document.getElementById("txtNoMesin").value; // 02055200719842
    	document.main_form.hidNoPlat.value = vNoPlat;
    	document.main_form.hidNoPolis.value = vNoPolis;
    	document.main_form.hidNoRangka.value = vNoRangka;
    	document.main_form.hidNoMesin.value = vNoMesin;
		document.main_form.hidMode.value = 1;
        document.main_form.method = "POST";
        document.main_form.action = "<%= lStrLocalPath %>BBApp_cMobilScreen";
        document.main_form.submit();
	}
    </script>    
</head>
<body>
 	<form name="main_form">
		<input type="hidden" name="hidMode" id="hidMode" />
		<input type="hidden" name="hidNoKartu" id="hidNoKartu" />
		<input type="hidden" name="hidNoPolis" id="hidNoPolis" />
		<input type="hidden" name="hidNoReg" id="hidNoReg" />
		<input type="hidden" name="hidTglLahir" id="hidTglLahir" />
		<input type="hidden" name="hidNoPlat" id="hidNoPlat" />
		<input type="hidden" name="hidNoRangka" id="hidNoRangka" />
		<input type="hidden" name="hidNoMesin" id="hidNoMesin" />
	    <table width="100%" border="0">
	    <!--
	    	<tr valign="top">
	    		<td>
	    			<img src="http://localhost:8080/SimasServerBB/images/logoASM.jpg"></img>
	    		</td>
	    	</tr>
	    	<tr>
	    		<td>
	    			<hr width="100%" style="color: red;"></hr>
	    		</td>
	    	</tr>
	    -->
	    	<tr>
	    		<td>
	    			<button type="button" name="btSSehat" id="btSSehat" onclick="fnStatusPolis()">
	    				<font style="font-size: x-small">Status Polis</font>
	    			</button>
	    			&nbsp;
	    			<button type="button" name="btISimas" id="btISimas" onclick="fnInfoSimas()">
	    				<font style="font-size: x-small">Info Simas</font>
	    			</button>
	    		</td>
	    	</tr>
	    	<tr id="rowSlctStsPolis" style="display: none;">
	    		<td>
	    			<select name="slctStsPolis" id="slctStsPolis" onchange="fnSlctStsPolis()">
	    				<option value="0"><font style="font-size: x-small">- Pilih Jenis Polis -</font></option>
	    				<option value="1"><font style="font-size: x-small">Simas Sehat</font></option>
	    				<option value="2"><font style="font-size: x-small">Simas Mobil</font></option>
	    				<!-- 
	    				<option value="3"><font style="font-size: x-small">Simas Rumah</font></option>
	    				<option value="4"><font style="font-size: x-small">Simas Travel</font></option>
	    				<option value="5"><font style="font-size: x-small">Personal Accident</font></option>
	    				 -->
	    			</select>
	    		</td>
	    	</tr>
	    	<tr>
	    		<td style="background-color: gray">
	    			&nbsp;<label id="lblAktif" style="color: yellow;"></label>
	    		</td>
	    	</tr>
	    	
	    	<!--  Login Simas Sehat -->
	    	<tr id="rowLoginSimasSehat" style="display: none;">
	    		<td>
					<table border="0">
						<tr>
							<td>No Kartu</td>
							<td>&nbsp;:&nbsp;</td>
							<td>
								<input type="text" name="txtNoKartu" id="txtNoKartu"></input>
							</td>
						</tr>
						<tr>
							<td>No Polis</td>
							<td>&nbsp;:&nbsp;</td>
							<td>
								<input type="text" name="txtNoPolis" id="txtNoPolis"></input>
							</td>
						</tr>
						<tr>
							<td>No Reg</td>
							<td>&nbsp;:&nbsp;</td>
							<td>
								<input type="text" name="txtNoReg" id="txtNoReg"></input>
							</td>
						</tr>
						<tr>
							<td>Tgl Lahir</td>
							<td>&nbsp;:&nbsp;</td>
							<td>
								<input type="text" name="txtTglLahir" id="txtTglLahir"></input>
							</td>
						</tr>
						<tr>
							<td colspan="3">
								<button type="button" name="btLogin" id="btLogin" onclick="fnSimasSehat()">
									<font style="font-size: x-small">Submit</font>
								</button>
							</td>
						</tr>
					</table>
				</td>	    		
	    	</tr>
	    	
	    	<!--  Login Simas Mobil -->
	    	<tr id="rowLoginSimasMobil" style="display: none;">
	    		<td>
					<table border="0">
						<tr>
							<td>No Polis</td>
							<td>&nbsp;:&nbsp;</td>
							<td>
								<input type="text" name="txtNoPolis" id="txtNoPolis"></input>
							</td>
						</tr>
						<tr>
							<td>No Plat</td>
							<td>&nbsp;:&nbsp;</td>
							<td>
								<input type="text" name="txtNoPlat" id="txtNoPlat"></input>
							</td>
						</tr>
						<tr>
							<td>No Rangka</td>
							<td>&nbsp;:&nbsp;</td>
							<td>
								<input type="text" name="txtNoRangka" id="txtNoRangka"></input>
							</td>
						</tr>
						<tr>
							<td>No Mesin</td>
							<td>&nbsp;:&nbsp;</td>
							<td>
								<input type="text" name="txtNoMesin" id="txtNoMesin"></input>
							</td>
						</tr>
						
						<tr>
							<td colspan="3">
								<button type="button" name="btLogin1" id="btLogin1" onclick="fnSimasMobil()">
									<font style="font-size: x-small">Submit</font>
								</button>
							</td>
						</tr>
					</table>
				</td>	    		
	    	</tr>
	    	
	    </table>
	</form>
</body>
</html>
<%
}
catch(Exception e) {
	BBApp_Common.fnWriteLog("BBApp_LoginScreen","BBApp_LoginScreen[JSP]: ","Exception in BBApp_MainScreen: "+ e);
  	request.setAttribute("ErrorCode","2000");
%>
	<jsp:forward page="/UTIL_cERRORPAGE"></jsp:forward>
<%	
}
%>